package com.uzhie.jt808.msg.entity.JT_200;

import java.nio.charset.Charset;

/**
 * Created by TangFei on 2018/10/6.
 * 苏标 盲区监测系统报警 0X67
 */
public class JS_BlindAreaMonitorSystemWarn extends JS_SuperWarn {

    private int type;
    private int speed;

    @Override
    public int getAdditionalId() {
        return 0X67;
    }

    @Override
    public byte getAdditionalLength() {
        return 0;
    }

    @Override
    public byte[] WriteToBytes() {
        return new byte[0];
    }

    @Override
    public void ReadFromBytes() {
        logger.trace("解析苏标 0X67 指令");
        // 报警ID
        int warnID = buffer.getInt();
        // 标志状态
        byte flagStatus = buffer.get();
        // 报警/事件类型
        type = buffer.get();
        // 车速
        speed = buffer.get();
        // 高程
        short altitude = buffer.getShort();
        // 纬度
        int latitude = buffer.getInt();
        // 经度
        int longitude = buffer.getInt();
        // 日期时间
        String time = readBCDTime();
        // 车辆状态
        short vehicleStatusShort = buffer.getShort();
        // 报警标识号
        // 终端ID
        byte[] devIDBytes = new byte[7];
        buffer.get(devIDBytes,0,7);
        String devID = new String(devIDBytes, Charset.forName("GBK"));
        // 时间
        String time2 = readBCDTime();
        // 序号
        byte serialNumber = buffer.get();
        // 附件数量
        byte enclosureNumber = buffer.get();
        // 保留字段
        buffer.get();
    }

    public int getType() {
        return type;
    }

    public int getSpeed() {
        return speed;
    }
}
